<ui:composition template="/app/template/layout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="content">
		<f:event type="preRenderView"
		listener="#{utenteBean.loadCurrentUserDTO}" />
		<h:form>
			<p:panel header="Modifica profilo">
				In caso di modifica della mail sarà necessario rieffettuare il login.
				<p:messages for="profiloModResult" autoUpdate="true" />
				<h:panelGrid columns="3" id="profiloModGrid">
					<h:outputLabel for="mail">Mail:</h:outputLabel>
					<p:inputText id="mail" value="#{utenteBean.utenteDTO.mail}" />
					<p:message for="mail" />

					<h:outputLabel for="nome">Nome:</h:outputLabel>
					<p:inputText id="nome" value="#{utenteBean.utenteDTO.nome}" />
					<p:message for="nome" />

					<h:outputLabel for="cognome">Cognome:</h:outputLabel>
					<p:inputText id="cognome" value="#{utenteBean.utenteDTO.cognome}" />
					<p:message for="cognome" />

					<h:outputLabel for="indirizzo">Indirizzo:</h:outputLabel>
					<p:inputTextarea id="indirizzo" maxlenght="250" autoResize="true"
						value="#{utenteBean.utenteDTO.indirizzo}" />
					<p:message for="indirizzo" />

					<h:outputLabel for="password">Nuova password:</h:outputLabel>
					<p:password id="password" value="#{utenteBean.utenteDTO.password}"
						label="Password" />
					<p:message for="password" />
				</h:panelGrid>
				<p:commandButton value="Modifica" update="profiloModGrid"
					action="#{utenteBean.modificaProfilo()}" />
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
